/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Integration;

/**
 *
 * @author mark
 */
public class Func2D2 implements IFunction2D{

    public double bi,bj,bk,ci,cj,ck,S2;

    public double calculate(double x, double y) {
        double res =0;
        switch(i){
            case 1: return bi*(4*x-1)/S2;
            case 2: return 4*(bj*x+bi*y);
            case 3: return bj*(4*y-1)/S2;
            case 4: return 4*(bj*(1-x-y)+bk*y);
            case 5: return bk*(4*x-1)/S2;
            case 6: return 4*(bk*x+bi*(1-x-y));
            default: res = 0.0;
        }
        return res;
    }

    public double calculateDerivatyX(double x, double y) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public double calculateDerivatyY(double x, double y) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public int i;
    public int j;

}
